Open AlexisAmd opened 4 months ago
As it's not officially supported, I have to do it myself. My solution is simple and just show the example value like clicking "Try it out". Even though it's not as fancy as your example, it's better than nothing.
https://github.com/kenspirit/swagger-ui/commit/d325fd8392c9a10000699204f9619fb27990df78
Need it + 1
As it's not officially supported, I have to do it myself. My solution is simple and just show the example value like clicking "Try it out". Even though it's not as fancy as your example, it's better than nothing.
The change can be checked for a better handling now in: https://github.com/kenspirit/swagger-ui/tree/multipart-body-show-schema
Content & configuration
Swagger/OpenAPI definition:
Is your feature request related to a problem?
In the example provided the 'metadata' which is an object property property is defined using a schema. After clicking on 'Try it out' an example based on this schema is displayed, however the schema is not displayed in Swagger UI.
Consequently :
As API provider I have to provide a link in description to inform consummer that the json for the property should follow the schema![image](https://github.com/swagger-api/swagger-ui/assets/20322719/1f701732-ca24-4b33-9f3a-f4c0a2ec4f7e)
As API consumer I have to scroll down to the bottom of the OAS definition to display the schema.![image](https://github.com/swagger-api/swagger-ui/assets/20322719/cb5a006d-a7c8-4737-8921-cef862e9484c)
Describe the solution you'd like
With the impovement, for each obect property, the user is allowed to choose between 'Example value' and 'Schema'![image](https://github.com/swagger-api/swagger-ui/assets/20322719/f446caf3-8694-45f8-9c58-8d48540541a2)
Describe alternatives you've considered
Current solution : Add link to the schema in endpoint's description
Additional context
The purpose of this endpoint is to offer a versatile method for uploading files and associated metadata of various types. The set of metadata required depends on the nature of the file, such as Invoicing or Identification documents (see Schemas for examples).
Related issues :
5169
-> Is asking to show a preview of the payload (an example) without clicking on "Try it out"
4581
-> Is asking the same as this one but for query parameters
7696
-> Same as 4581