fix: repair how multiple examples are declared in web_api #243
+20
−22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before fastapi 0.99, we could declare multiple examples with
Now, examples no longer accept keys or metadata, just a list of plain examples.
Since fastapi 0.103, using openapi_examples instead restores the old key and metadata functionality.
See https://fastapi.tiangolo.com/tutorial/schema-extra-example/#using-the-openapi_examples-parameter for details.
PR Goal?
Make the examples for
/assemble
work again on https://readalong-studio.herokuapp.com/api/v1/docs#/default/assemble_assemble_postFixes?
Currently, the proposed example is invalid:
This PR brings it back to what we used to have:
Feedback sought?
sanity checking
Priority?
low
Tests added?
n/a
How to test?
then navigate to
http://localhost:8000/api/v1/docs#/default/assemble_assemble_post
and see the two examples being proposed instead of the big invalid block.
Confidence?
high
Version change?
no