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 use the swagger-ui to document my APIs , I have to add the business error codes that those APIs return in response ,I see that is not part of the openApi specification so I did an alternative solution based on the tag "description" in the yaml file.
OpenAPI definition:
application/xml:
schema:
$ref: '#/components/schemas/GetProductDetailsV35Rq'responses:
200:
description:
<div>Successful<p>Business Error Codes :</p><table><tr><th>Error code</th><th>Error Description</th></tr><tr><td>31101</td> <td>Invalid Catalog Product Id</td></tr><tr><td>31102</td> <td>Invalid Catalog Product version</td></tr><tr><td>31103</td> <td>Catalog Product Pack Code</td></tr></table></div> ### Describe the solution you'd likeI added the table of error codes using the "description" tag in the yaml ,this is rendered as :
![test](https://github.com/swagger-api/swagger-ui/assets/16072199/0bd7c09c-bdf0-4461-bd0f-8b169ade6b8d)### Describe alternatives you've consideredI'm asking if we can add a component that we can use it to display the error codes without use the yaml "description" tag
The text was updated successfully, but these errors were encountered:
e2rabi
changed the title
Can we add a component of a section to add buissness or technical error for the API ?
Can we add a component or a section to add buissness or technical error for the API ?
Apr 26, 2024
Content & configuration
I use the swagger-ui to document my APIs , I have to add the business error codes that those APIs return in response ,I see that is not part of the openApi specification so I did an alternative solution based on the tag "description" in the yaml file.
OpenAPI definition:
The text was updated successfully, but these errors were encountered: