{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback-next/issues/3698","repository_url":"https://api.github.com/repos/strongloop/loopback-next","labels_url":"https://api.github.com/repos/strongloop/loopback-next/issues/3698/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback-next/issues/3698/comments","events_url":"https://api.github.com/repos/strongloop/loopback-next/issues/3698/events","html_url":"https://github.com/strongloop/loopback-next/issues/3698","id":491668230,"node_id":"MDU6SXNzdWU0OTE2NjgyMzA=","number":3698,"title":"Semantic Error at OASv3 for 'MessageExcluding[id]':","user":{"login":"remkohdev","id":1062709,"node_id":"MDQ6VXNlcjEwNjI3MDk=","avatar_url":"https://avatars3.githubusercontent.com/u/1062709?v=4","gravatar_id":"","url":"https://api.github.com/users/remkohdev","html_url":"https://github.com/remkohdev","followers_url":"https://api.github.com/users/remkohdev/followers","following_url":"https://api.github.com/users/remkohdev/following{/other_user}","gists_url":"https://api.github.com/users/remkohdev/gists{/gist_id}","starred_url":"https://api.github.com/users/remkohdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/remkohdev/subscriptions","organizations_url":"https://api.github.com/users/remkohdev/orgs","repos_url":"https://api.github.com/users/remkohdev/repos","events_url":"https://api.github.com/users/remkohdev/events{/privacy}","received_events_url":"https://api.github.com/users/remkohdev/received_events","type":"User","site_admin":false},"labels":[{"id":514690858,"node_id":"MDU6TGFiZWw1MTQ2OTA4NTg=","url":"https://api.github.com/repos/strongloop/loopback-next/labels/bug","name":"bug","color":"e99695","default":true},{"id":779763959,"node_id":"MDU6TGFiZWw3Nzk3NjM5NTk=","url":"https://api.github.com/repos/strongloop/loopback-next/labels/community-contribution","name":"community-contribution","color":"77d11d","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2019-09-10T13:20:02Z","updated_at":"2019-10-02T19:27:27Z","closed_at":"2019-10-02T19:27:27Z","author_association":"NONE","body":"A Loopback4 generated application (https://github.com/remkohdev/guestbook101/blob/master/Lab0/README_w_lb4_cli.md) provides an OAS v3 that gives me the following semantic error in [Swagger editor](http://editor.swagger.io/), which I assume uses Swagger Validator. I validated the Swagger in Swagger Editor after getting issues in API Connect (I now realize I should not be using v3 at all, when using API Connect, which means I cannot use Appsody, LB4 CLI, that's another story)\r\n\r\nIf I go to editor.swagger.io and import my OAS in Loopback4 (http://169.63.218.104:32145/openapi.yaml), the validator throws a semantic error 👍 \r\n\r\n```text\r\nSemantic Error at paths./messages.post.requestBody.content.application/json.schema.$ref\r\n$ref values must be RFC3986-compliant percent-encoded URIs\r\nJump to line 190\r\n```\r\n\r\nLine 190 refers to `$ref: '#/components/schemas/MessageExcluding[id]'`   that points to\r\n\r\n```yaml\r\n     'MessageExcluding[id]':\r\n     title: 'MessageExcluding[id]'\r\n     not:\r\n       anyOf:\r\n         - required:\r\n             - id\r\n     properties:\r\n```\r\n\r\nI can resolve the error in Swagger Editor by URLEncoding the square brackets as follows:  $ref: '#/components/schemas/MessageExcluding%5Bid%5D' \r\n\r\nDoes this mean the Loopback 4 application wrongly generates the ref? or is the error in the swagger validator in the swagger editor? \r\n\r\n```yaml\r\n{\r\n  \"openapi\": \"3.0.0\",\r\n  \"info\": {\r\n    \"title\": \"LoopBack Application\",\r\n    \"version\": \"1.0.0\"\r\n  },\r\n  \"paths\": {\r\n    \"/addresses/{id}/contact\": {\r\n      \"get\": {\r\n        \"x-controller-name\": \"AddressContactController\",\r\n        \"x-operation-name\": \"getContact\",\r\n        \"tags\": [\r\n          \"AddressContactController\"\r\n        ],\r\n        \"responses\": {\r\n          \"200\": {\r\n            \"description\": \"Contact belonging to Address\",\r\n            \"content\": {\r\n              \"application/json\": {\r\n                \"schema\": {\r\n                  \"type\": \"array\",\r\n                  \"items\": {\r\n                    \"$ref\": \"#/components/schemas/Contact\"\r\n                  }\r\n                }\r\n              }\r\n            }\r\n          }\r\n        },\r\n        \"parameters\": [\r\n          {\r\n            \"name\": \"id\",\r\n            \"in\": \"path\",\r\n            \"schema\": {\r\n              \"type\": \"number\"\r\n            },\r\n            \"required\": true\r\n          }\r\n        ],\r\n        \"operationId\": \"AddressContactController.getContact\"\r\n      }\r\n    },\r\n    \"/contacts/{id}/person\": {\r\n      \"get\": {\r\n        \"x-controller-name\": \"ContactPersonController\",\r\n        \"x-operation-name\": \"getPerson\",\r\n        \"tags\": [\r\n          \"ContactPersonController\"\r\n        ],\r\n        \"responses\": {\r\n          \"200\": {\r\n            \"description\": \"Person belonging to Contact\",\r\n            \"content\": {\r\n              \"application/json\": {\r\n                \"schema\": {\r\n                  \"type\": \"array\",\r\n                  \"items\": {\r\n                    \"$ref\": \"#/components/schemas/Person\"\r\n                  }\r\n                }\r\n              }\r\n            }\r\n          }\r\n        },\r\n        \"parameters\": [\r\n          {\r\n            \"name\": \"id\",\r\n            \"in\": \"path\",\r\n            \"schema\": {\r\n              \"type\": \"number\"\r\n            },\r\n            \"required\": true\r\n          }\r\n        ],\r\n        \"operationId\": \"ContactPersonController.getPerson\"\r\n      }\r\n    },\r\n    \"/messages/count\": {\r\n      \"get\": {\r\n        \"x-controller-name\": \"MessagesController\",\r\n        \"x-operation-name\": \"count\",\r\n        \"tags\": [\r\n          \"MessagesController\"\r\n        ],\r\n        \"responses\": {\r\n          \"200\": {\r\n            \"description\": \"Message model count\",\r\n            \"content\": {\r\n              \"application/json\": {\r\n                \"schema\": {\r\n                  \"type\": \"object\",\r\n                  \"properties\": {\r\n                    \"count\": {\r\n                      \"type\": \"number\"\r\n                    }\r\n                  }\r\n                }\r\n              }\r\n            }\r\n          }\r\n        },\r\n        \"parameters\": [\r\n          {\r\n            \"name\": \"where\",\r\n            \"in\": \"query\",\r\n            \"style\": \"deepObject\",\r\n            \"explode\": true,\r\n            \"schema\": {\r\n              \"type\": \"object\"\r\n            }\r\n          }\r\n        ],\r\n        \"operationId\": \"MessagesController.count\"\r\n      }\r\n    },\r\n    \"/messages/{id}/person\": {\r\n      \"get\": {\r\n        \"x-controller-name\": \"MessagePersonController\",\r\n        \"x-operation-name\": \"getPerson\",\r\n        \"tags\": [\r\n          \"MessagePersonController\"\r\n        ],\r\n        \"responses\": {\r\n          \"200\": {\r\n            \"description\": \"Person belonging to Message\",\r\n            \"content\": {\r\n              \"application/json\": {\r\n                \"schema\": {\r\n                  \"type\": \"array\",\r\n                  \"items\": {\r\n                    \"$ref\": \"#/components/schemas/Person\"\r\n                  }\r\n                }\r\n              }\r\n            }\r\n          }\r\n        },\r\n        \"parameters\": [\r\n          {\r\n            \"name\": \"id\",\r\n            \"in\": \"path\",\r\n            \"schema\": {\r\n              \"type\": \"number\"\r\n            },\r\n            \"required\": true\r\n          }\r\n        ],\r\n        \"operationId\": \"MessagePersonController.getPerson\"\r\n      }\r\n    },\r\n    \"/messages/{id}\": {\r\n      \"put\": {\r\n        \"x-controller-name\": \"MessagesController\",\r\n        \"x-operation-name\": \"replaceById\",\r\n        \"tags\": [\r\n          \"MessagesController\"\r\n        ],\r\n        \"responses\": {\r\n          \"204\": {\r\n            \"description\": \"Message PUT success\"\r\n          }\r\n        },\r\n        \"parameters\": [\r\n          {\r\n            \"name\": \"id\",\r\n            \"in\": \"path\",\r\n            \"schema\": {\r\n              \"type\": \"number\"\r\n            },\r\n            \"required\": true\r\n          }\r\n        ],\r\n        \"requestBody\": {\r\n          \"content\": {\r\n            \"application/json\": {\r\n              \"schema\": {\r\n                \"$ref\": \"#/components/schemas/Message\"\r\n              }\r\n            }\r\n          },\r\n          \"x-parameter-index\": 1\r\n        },\r\n        \"operationId\": \"MessagesController.replaceById\"\r\n      },\r\n      \"patch\": {\r\n        \"x-controller-name\": \"MessagesController\",\r\n        \"x-operation-name\": \"updateById\",\r\n        \"tags\": [\r\n          \"MessagesController\"\r\n        ],\r\n        \"responses\": {\r\n          \"204\": {\r\n            \"description\": \"Message PATCH success\"\r\n          }\r\n        },\r\n        \"parameters\": [\r\n          {\r\n            \"name\": \"id\",\r\n            \"in\": \"path\",\r\n            \"schema\": {\r\n              \"type\": \"number\"\r\n            },\r\n            \"required\": true\r\n          }\r\n        ],\r\n        \"requestBody\": {\r\n          \"content\": {\r\n            \"application/json\": {\r\n              \"schema\": {\r\n                \"$ref\": \"#/components/schemas/MessagePartial\"\r\n              }\r\n            }\r\n          },\r\n          \"x-parameter-index\": 1\r\n        },\r\n        \"operationId\": \"MessagesController.updateById\"\r\n      },\r\n      \"get\": {\r\n        \"x-controller-name\": \"MessagesController\",\r\n        \"x-operation-name\": \"findById\",\r\n        \"tags\": [\r\n          \"MessagesController\"\r\n        ],\r\n        \"responses\": {\r\n          \"200\": {\r\n            \"description\": \"Message model instance\",\r\n            \"content\": {\r\n              \"application/json\": {\r\n                \"schema\": {\r\n                  \"$ref\": \"#/components/schemas/Message\"\r\n                }\r\n              }\r\n            }\r\n          }\r\n        },\r\n        \"parameters\": [\r\n          {\r\n            \"name\": \"id\",\r\n            \"in\": \"path\",\r\n            \"schema\": {\r\n              \"type\": \"number\"\r\n            },\r\n            \"required\": true\r\n          }\r\n        ],\r\n        \"operationId\": \"MessagesController.findById\"\r\n      },\r\n      \"delete\": {\r\n        \"x-controller-name\": \"MessagesController\",\r\n        \"x-operation-name\": \"deleteById\",\r\n        \"tags\": [\r\n          \"MessagesController\"\r\n        ],\r\n        \"responses\": {\r\n          \"204\": {\r\n            \"description\": \"Message DELETE success\"\r\n          }\r\n        },\r\n        \"parameters\": [\r\n          {\r\n            \"name\": \"id\",\r\n            \"in\": \"path\",\r\n            \"schema\": {\r\n              \"type\": \"number\"\r\n            },\r\n            \"required\": true\r\n          }\r\n        ],\r\n        \"operationId\": \"MessagesController.deleteById\"\r\n      }\r\n    },\r\n    \"/messages\": {\r\n      \"post\": {\r\n        \"x-controller-name\": \"MessagesController\",\r\n        \"x-operation-name\": \"create\",\r\n        \"tags\": [\r\n          \"MessagesController\"\r\n        ],\r\n        \"responses\": {\r\n          \"200\": {\r\n            \"description\": \"Message model instance\",\r\n            \"content\": {\r\n              \"application/json\": {\r\n                \"schema\": {\r\n                  \"$ref\": \"#/components/schemas/Message\"\r\n                }\r\n              }\r\n            }\r\n          }\r\n        },\r\n        \"requestBody\": {\r\n          \"content\": {\r\n            \"application/json\": {\r\n              \"schema\": {\r\n                \"$ref\": \"#/components/schemas/MessageExcluding[id]\"\r\n              }\r\n            }\r\n          }\r\n        },\r\n        \"operationId\": \"MessagesController.create\"\r\n      },\r\n      \"patch\": {\r\n        \"x-controller-name\": \"MessagesController\",\r\n        \"x-operation-name\": \"updateAll\",\r\n        \"tags\": [\r\n          \"MessagesController\"\r\n        ],\r\n        \"responses\": {\r\n          \"200\": {\r\n            \"description\": \"Message PATCH success count\",\r\n            \"content\": {\r\n              \"application/json\": {\r\n                \"schema\": {\r\n                  \"type\": \"object\",\r\n                  \"properties\": {\r\n                    \"count\": {\r\n                      \"type\": \"number\"\r\n                    }\r\n                  }\r\n                }\r\n              }\r\n            }\r\n          }\r\n        },\r\n        \"parameters\": [\r\n          {\r\n            \"name\": \"where\",\r\n            \"in\": \"query\",\r\n            \"style\": \"deepObject\",\r\n            \"explode\": true,\r\n            \"schema\": {\r\n              \"type\": \"object\"\r\n            }\r\n          }\r\n        ],\r\n        \"requestBody\": {\r\n          \"content\": {\r\n            \"application/json\": {\r\n              \"schema\": {\r\n                \"$ref\": \"#/components/schemas/MessagePartial\"\r\n              }\r\n            }\r\n          }\r\n        },\r\n        \"operationId\": \"MessagesController.updateAll\"\r\n      },\r\n      \"get\": {\r\n        \"x-controller-name\": \"MessagesController\",\r\n        \"x-operation-name\": \"find\",\r\n        \"tags\": [\r\n          \"MessagesController\"\r\n        ],\r\n        \"responses\": {\r\n          \"200\": {\r\n            \"description\": \"Array of Message model instances\",\r\n            \"content\": {\r\n              \"application/json\": {\r\n                \"schema\": {\r\n                  \"type\": \"array\",\r\n                  \"items\": {\r\n                    \"$ref\": \"#/components/schemas/Message\"\r\n                  }\r\n                }\r\n              }\r\n            }\r\n          }\r\n        },\r\n        \"parameters\": [\r\n          {\r\n            \"name\": \"filter\",\r\n            \"in\": \"query\",\r\n            \"style\": \"deepObject\",\r\n            \"explode\": true,\r\n            \"schema\": {\r\n              \"type\": \"object\",\r\n              \"properties\": {\r\n                \"where\": {\r\n                  \"type\": \"object\"\r\n                },\r\n                \"fields\": {\r\n                  \"type\": \"object\",\r\n                  \"properties\": {\r\n                    \"id\": {\r\n                      \"type\": \"boolean\"\r\n                    },\r\n                    \"text\": {\r\n                      \"type\": \"boolean\"\r\n                    },\r\n                    \"datecreated\": {\r\n                      \"type\": \"boolean\"\r\n                    },\r\n                    \"personId\": {\r\n                      \"type\": \"boolean\"\r\n                    }\r\n                  }\r\n                },\r\n                \"offset\": {\r\n                  \"type\": \"integer\",\r\n                  \"minimum\": 0\r\n                },\r\n                \"limit\": {\r\n                  \"type\": \"integer\",\r\n                  \"minimum\": 0\r\n                },\r\n                \"skip\": {\r\n                  \"type\": \"integer\",\r\n                  \"minimum\": 0\r\n                },\r\n                \"order\": {\r\n                  \"type\": \"array\",\r\n                  \"items\": {\r\n                    \"type\": \"string\"\r\n                  }\r\n                },\r\n                \"include\": {\r\n                  \"type\": \"array\",\r\n                  \"items\": {\r\n                    \"type\": \"object\",\r\n                    \"properties\": {\r\n                      \"relation\": {\r\n                        \"type\": \"string\"\r\n                      },\r\n                      \"scope\": {\r\n                        \"properties\": {\r\n                          \"where\": {\r\n                            \"type\": \"object\"\r\n                          },\r\n                          \"fields\": {\r\n                            \"type\": \"object\",\r\n                            \"properties\": {}\r\n                          },\r\n                          \"offset\": {\r\n                            \"type\": \"integer\",\r\n                            \"minimum\": 0\r\n                          },\r\n                          \"limit\": {\r\n                            \"type\": \"integer\",\r\n                            \"minimum\": 0\r\n                          },\r\n                          \"skip\": {\r\n                            \"type\": \"integer\",\r\n                            \"minimum\": 0\r\n                          },\r\n                          \"order\": {\r\n                            \"type\": \"array\",\r\n                            \"items\": {\r\n                              \"type\": \"string\"\r\n                            }\r\n                          }\r\n                        }\r\n                      }\r\n                    }\r\n                  }\r\n                }\r\n              }\r\n            }\r\n          }\r\n        ],\r\n        \"operationId\": \"MessagesController.find\"\r\n      }\r\n    },\r\n    \"/ping\": {\r\n      \"get\": {\r\n        \"x-controller-name\": \"PingController\",\r\n        \"x-operation-name\": \"ping\",\r\n        \"tags\": [\r\n          \"PingController\"\r\n        ],\r\n        \"responses\": {\r\n          \"200\": {\r\n            \"description\": \"Ping Response\",\r\n            \"content\": {\r\n              \"application/json\": {\r\n                \"schema\": {\r\n                  \"type\": \"object\",\r\n                  \"properties\": {\r\n                    \"greeting\": {\r\n                      \"type\": \"string\"\r\n                    },\r\n                    \"date\": {\r\n                      \"type\": \"string\"\r\n                    },\r\n                    \"url\": {\r\n                      \"type\": \"string\"\r\n                    },\r\n                    \"headers\": {\r\n                      \"type\": \"object\",\r\n                      \"properties\": {\r\n                        \"Content-Type\": {\r\n                          \"type\": \"string\"\r\n                        }\r\n                      },\r\n                      \"additionalProperties\": true\r\n                    }\r\n                  }\r\n                }\r\n              }\r\n            }\r\n          }\r\n        },\r\n        \"operationId\": \"PingController.ping\"\r\n      }\r\n    }\r\n  },\r\n  \"servers\": [\r\n    {\r\n      \"url\": \"http://169.63.218.104:32145\"\r\n    }\r\n  ],\r\n  \"components\": {\r\n    \"schemas\": {\r\n      \"Contact\": {\r\n        \"title\": \"Contact\",\r\n        \"properties\": {\r\n          \"id\": {\r\n            \"type\": \"number\"\r\n          },\r\n          \"email\": {\r\n            \"type\": \"string\"\r\n          },\r\n          \"phone\": {\r\n            \"type\": \"string\"\r\n          },\r\n          \"personId\": {\r\n            \"type\": \"number\"\r\n          }\r\n        }\r\n      },\r\n      \"Person\": {\r\n        \"title\": \"Person\",\r\n        \"properties\": {\r\n          \"id\": {\r\n            \"type\": \"number\"\r\n          },\r\n          \"firstname\": {\r\n            \"type\": \"string\"\r\n          },\r\n          \"lastname\": {\r\n            \"type\": \"string\"\r\n          },\r\n          \"username\": {\r\n            \"type\": \"string\"\r\n          }\r\n        }\r\n      },\r\n      \"Message\": {\r\n        \"title\": \"Message\",\r\n        \"properties\": {\r\n          \"id\": {\r\n            \"type\": \"number\"\r\n          },\r\n          \"text\": {\r\n            \"type\": \"string\"\r\n          },\r\n          \"datecreated\": {\r\n            \"type\": \"string\",\r\n            \"format\": \"date-time\"\r\n          },\r\n          \"personId\": {\r\n            \"type\": \"number\"\r\n          }\r\n        },\r\n        \"required\": [\r\n          \"text\"\r\n        ]\r\n      },\r\n      \"MessageExcluding[id]\": {\r\n        \"title\": \"MessageExcluding[id]\",\r\n        \"not\": {\r\n          \"anyOf\": [\r\n            {\r\n              \"required\": [\r\n                \"id\"\r\n              ]\r\n            }\r\n          ]\r\n        },\r\n        \"properties\": {\r\n          \"text\": {\r\n            \"type\": \"string\"\r\n          },\r\n          \"datecreated\": {\r\n            \"type\": \"string\",\r\n            \"format\": \"date-time\"\r\n          },\r\n          \"personId\": {\r\n            \"type\": \"number\"\r\n          }\r\n        },\r\n        \"required\": [\r\n          \"text\"\r\n        ]\r\n      },\r\n      \"MessagePartial\": {\r\n        \"title\": \"MessagePartial\",\r\n        \"properties\": {\r\n          \"id\": {\r\n            \"type\": \"number\"\r\n          },\r\n          \"text\": {\r\n            \"type\": \"string\"\r\n          },\r\n          \"datecreated\": {\r\n            \"type\": \"string\",\r\n            \"format\": \"date-time\"\r\n          },\r\n          \"personId\": {\r\n            \"type\": \"number\"\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n```"},"comment":{"url":"https://api.github.com/repos/strongloop/loopback-next/issues/comments/537643292","html_url":"https://github.com/strongloop/loopback-next/issues/3698#issuecomment-537643292","issue_url":"https://api.github.com/repos/strongloop/loopback-next/issues/3698","id":537643292,"node_id":"MDEyOklzc3VlQ29tbWVudDUzNzY0MzI5Mg==","user":{"login":"dhmlau","id":25489897,"node_id":"MDQ6VXNlcjI1NDg5ODk3","avatar_url":"https://avatars3.githubusercontent.com/u/25489897?v=4","gravatar_id":"","url":"https://api.github.com/users/dhmlau","html_url":"https://github.com/dhmlau","followers_url":"https://api.github.com/users/dhmlau/followers","following_url":"https://api.github.com/users/dhmlau/following{/other_user}","gists_url":"https://api.github.com/users/dhmlau/gists{/gist_id}","starred_url":"https://api.github.com/users/dhmlau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhmlau/subscriptions","organizations_url":"https://api.github.com/users/dhmlau/orgs","repos_url":"https://api.github.com/users/dhmlau/repos","events_url":"https://api.github.com/users/dhmlau/events{/privacy}","received_events_url":"https://api.github.com/users/dhmlau/received_events","type":"User","site_admin":false},"created_at":"2019-10-02T19:27:27Z","updated_at":"2019-10-02T19:27:27Z","author_association":"CONTRIBUTOR","body":"Since PR #3504 has landed, this issue should be resolved.  Closing this."}}
{"actor":{"display_login":"dhmlau"}}