Redocly/redocly-cli

example is not bundled

ckw28502 opened this issue · 1 comments

Hi, this is my first time using any openapi but i am faced with this problem.

Screenshot 2024-04-02 095655

So image above is the openapi.yaml files.
for the parameters, i referenced them to another yaml files. Lets take the settlement for Austria for example
The settlement is referenced to a file at this location : "./parameters/location/settlement/AT.yaml"

Screenshot 2024-04-02 095828
This is the referenced settlement for Austria file. It has example and another reference to settlement.yaml. settlement.yaml is used for every country including Austria.

Screenshot 2024-04-02 100133
This is the settlement.yaml file

The problem occur after i bundle them using this command

 npx @redocly/openapi-cli bundle public_api/v2/openapi/openapi.yaml -o openapi.yaml -d --remove-unused-components

after that, the example is not shown in the bundled yaml file
Screenshot 2024-04-02 100456

Is there something i did wrong? because it works fine when im using swagger but this problem occured when using Redocly

Hi @ckw28502! You're using a reference object which could only contain a summary and a description alongside the $ref. All other fields shall be ignored. So you're not supposed to extend the $ref with required or example properties.

However, I see that the required gets projected to the parameters and that actually looks like a bug to me. There's already another issue on that, so I'm closing this one. Feel free to add your comments there or reply here in case I'm missing something.