Forum Discussion
chichepo as mentioned previously I have also vastly used this pattern - here is an example of overwriting the `example` value of `isShipperOwned` property
Apparently SwaggerHub accepts this pattern. I tried the same in reDocly - but here it does not work. I have not tried it - but this (mis)use of allOf also breaks code-generators. Have you tried to generate code via the SwaggerHub page? Does the code generated work?
The new OAS 3.1 allows for a "description"-sibling next to the $ref. In OAS 3.1 you can overwrite (legally) the description of a field you are referring to ($ref)
Unfortunately you still cannot overwrite the `example` property 😞
- chichepo2 years agoChampion Level 2
Apparently SwaggerHub accepts this pattern. I tried the same in reDocly - but here it does not work.
I was not aware about such issue on redocly. You are rigth it is, obviously, not supported.
SwaggerHub Redocly
Regarding the code generation, in my previous response, the code was generated correctly, but "description" or "example" are not "demonstrative" attributes when talking about codegen.
I'll try something like dealing with different patterns or types.
I'll let you know.- chichepo2 years agoChampion Level 2
HenrikHL
I dug a little deeper in using allOf and the code generation.
Look at the 2 cases I tried.
Case #1:Yaml definition SwaggerHub Doc C# code generated Case #2:
Yaml Definition SwaggerHub Doc C# code generated I am not sure if it is what you meant when you asked:
"Have you tried to generate code via the SwaggerHub page?"I was expecting to get class model that support the whole properties list.
I am looking to hear, in this forum, some comments about this code.
Related Content
- 3 years ago
- 6 years ago
- 9 years ago
- 7 years ago
Recent Discussions
- 12 days ago
- 31 days ago