-
Notifications
You must be signed in to change notification settings - Fork 420
Bug: openAPI generation - operation requestBody description only on schema output, not at higher level needed for html #3539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Looking at this now |
Hi @MCR2019 I've tried to use ![]() With you change, what would be different in the UI? |
Hi @rubenfonseca , thanks for taking a look at that so quickly and apologies that my example wasn't as accurate as it could be. I've had another look at it and updated the requestBody so that it uses a Pydantic schema for the type (which is what I would use to enable validation). example code is now:
this produces the spec: which when an html file is generated using (There is no description for the request body)
Manually updating the json spec file to include a description in the and generating html file with ![]() Hopefully that illustrates the issue more clearly, I'll keep looking into what's going on and add more details if I can. Thanks |
This helps a lot! Let me see what's missing on our side. |
|
This is now released under 2.31.0 version! |
Expected Behaviour
When creating an operation such as a PUT with a body parameter, the body parameter description should be populated on the output at the requestBody level (when generating the spec with app.get_openapi_json_schema() ).
Current Behaviour
When creating an operation such as a PUT with a body parameter, the body parameter description only appears in the output under schema (when generating the spec with app.get_openapi_json_schema() ).
Current output shows requestBody description only at the schema level, this means that when redocly is used to create an html file from the spec the description does not appear.
For the path parameter the descrition is populated at two levels which means it does appear in the redocly generated html.
Current output:

OAS 3.1.0 looks as though it is possible to populate the description on the requestBody object as well:

Code snippet
Possible Solution
Populate description on the requestBody object as well as the schema.
Steps to Reproduce
Create an operation with a request body and add a description to the Body object.
Add a path parameter with a description to the operation.
Note on the output where description is populated in two places for the path parameter and only in one place for the body.
Optional -> Can generate a .html using redocly to confirm which of the descriptions makes it into the generated documentation.
Powertools for AWS Lambda (Python) version
2.30.2
AWS Lambda function runtime
3.10
Packaging format used
PyPi
Debugging logs
No response
The text was updated successfully, but these errors were encountered: