openapi-preprocessor
openapi-preprocessor copied to clipboard
YAML objects named "components" don't resolve
If I create a YAML object named "components" in my input.yaml file, any $ref, $inline or $merge commands don't resolve. It works fine if I name it "component" though.
Example input file with "components":
components:
$inline: /../../openapi/openapi.json#/components
Example output:
{
"components": {
"$inline": "/../../openapi/openapi.json#/components"
}
}
And when I rename it to "component":
Example input file:
component:
$inline: /../../openapi/openapi.json#/components
Example output:
{
"component": {
"BearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
I think I'm on the latest version: v0.0.0-20210319105711-a82b92013e23
@dolmen, can you help?
/components is handled specially and it looks like there is a bug here.
Here is a workaround: use $inline on child properties of /components:
{
"components": {
"schemas": {
"$inline": "../../openapi/openapi.json#/components/schemas"
},
"responses": {
"$inline": "../../openapi/openapi.json#/components/responses"
},
...
}