-
Notifications
You must be signed in to change notification settings - Fork 80
Description
Running my openapi.yml file though speccy resolve creates invalid files when keys include a + symbol.
Detailed description
My openapi.yml file includes keys that contain a + (file abbreviated for clarity):
get:
responses:
200:
content:
application/vnd.api+json:
schema:
$ref: xyz.jsonWhen running this file through speccy resolve, the resolved file contains the original application/vnd.api+json plus another key on the same level where the plus has been replaced with a space (application/vnd.api json) and the $ref pointing (but incorrectly) to the newly inserted key.
get:
responses:
200:
content:
application/vnd.api+json:
schema:
$ref: "#/paths/get/responses/200/content/application~1vnd.api%2Bjson/schema"
application/vnd.api json:
schema:
some: resolved dataThe %2B in the $ref is actually a + again when running it through decodeURIComponent. It looks like somewhere these keys are www-form encoded back and forth and the created the wrong keys.
When removing the +, everythung works as expected and there is no more duplicate key.
I think this is a bug. Not sure if in speccy or one of the dependencies.
Your environment
- Node Version: 10.9.0
- Operating system and version (e.g. Ubuntu 16.04, Windows 7): OSX
- Speccy 0.8.6
- package-lock.json: https://gist.github.com/langalex/da5f0dd7bb9e119df0a8e92c9ae6122a