You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've created an issue Mermade/oas-kit#597 over at swagger2openapi regarding an anomaly with converting field descriptions on swagger 2.0 documents.
I wanted to lodge it here as well in the advent of a fix.
The the descriptions on fields for complex objects are overwritten with the description of the object definition itself, and losing context for the user e.g. instead of displaying "The weight (in kg)..." and "The volume (in m3)..." of a reusable measurement object definition, it displays "A generic measurement." for both fields.
(I'll come back to update this as the issue progresses, if this is the right way to handle things?)
The text was updated successfully, but these errors were encountered:
There is an option (CLI and programmatic) called refSiblings which defines the mode to handle $ref's with sibling properties, the valid values are remove (the default), preserve, and allOf, ...
Testing using refSiblings "preserve" makes the field's description available in the parsed swagger object. It can then be used when constructing a new FieldModel, so instead of displaying the description of the schema, it can now show the description of the field.
I'll do a bit more testing and submit a PR for review.
As per Redocly#2067, `swagger2openapi` needs `refSiblings: 'preserve'` to bring additional fields into the converted open-api object.
This makes the description field available to the `fieldSchema` objects, but it also needs to be merged into the field model to be shown in the UI.
I've created an issue Mermade/oas-kit#597 over at swagger2openapi regarding an anomaly with converting field descriptions on swagger 2.0 documents.
I wanted to lodge it here as well in the advent of a fix.
The the descriptions on fields for complex objects are overwritten with the description of the object definition itself, and losing context for the user e.g. instead of displaying "The weight (in kg)..." and "The volume (in m3)..." of a reusable measurement object definition, it displays "A generic measurement." for both fields.
(I'll come back to update this as the issue progresses, if this is the right way to handle things?)
The text was updated successfully, but these errors were encountered: