Open viper90 opened 3 years ago
I got the same issue with allOf too FYI.
For people reading along I found a work around.
Structure of my project:
Command to generate:
swagger-cli bundle api.yaml --outfile _build/api.yaml --type yaml
I was having issues because inside the commands.yaml where I had the following:
NewObj:
allOf:
- $ref: '#/components/schemas/Command'
- required:
- description
....
After bundling the Command ref was expanded. Which wasn't what I wanted.
The work around:
Add the following to the api.yaml
file:
components:
schemas:
Command:
$ref: './commands.yaml#/components/schemas/Command'
The resulting bundled file will now contain the $ref BANG!
When I try to bundle a set of schemas in a path using "anyOf" or "oneOf", the schemas are invalid. Tried adding a unique name for each of the schemas and adding/removing indentation, however this still didn't allow this usage to be bundled in to the flat file. Instead I have re-structured the output bundled file manually and move the schemas under
components: schemas:
and then manually create the $ref's for each of the schemas. I'm not sure if I added something to the schema file at the beginning, if this would then render correctly perhaps?Current output when bundled:
Working bundle: