-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
feat: pass examples given in the FieldDefinition
to the OpenAPIMediaType
#3222
base: v3.0
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v3.0 #3222 +/- ##
==========================================
- Coverage 98.26% 98.23% -0.04%
==========================================
Files 322 322
Lines 14733 14749 +16
Branches 2343 2352 +9
==========================================
+ Hits 14477 14488 +11
- Misses 117 119 +2
- Partials 139 142 +3 ☔ View full report in Codecov by Sentry. |
Original review/suggestions: |
@provinzkraut Hey! It has been awhile since I have worked on this feature. I had to create a new PR as I had some issues with the way I originally forked the project. That said, I have made the changes you mentioned in your review here: Tests and pre-commits seem to pass but I get |
|
65233a8
to
109c62f
Compare
039700c
to
f86920d
Compare
Hey! If anyone could check this out it would be much appreciated! I get this failure in the type-checking CI:
https://github.com/litestar-org/litestar/actions/runs/8480802759/job/23237155365?pr=3222#step:6:18 I had previously changed the types:
provinzkraut pointed out the following, which I agree with:
However, I'm not sure how to proceed. Thanks! |
There are 2 options:
(also, if you |
Awesome! I try to avoid @-ing unless its urgent but I'll keep it in mind! Thanks for your suggestions, I will try pointing to |
Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/3222 |
@provinzkraut - does this look ok 😅 ? I followed the suggestion of rebasing. Everything appears to be in order but I'm inexperienced with rebasing. It says 26 files have changed when, IIRC, I only changed ~3. Thanks again for the feedback/back and forth! |
…3204) * feat: Support `schema_extra` in `Parameter` and `Body` (litestar-org#3022) This adds sort of a backdoor for modifying the generated OpenAPI spec. The value is given as `dict[str, Any]` where the key must match with the keyword parameter name in `Schema`. The values are used to override items in the generated `Schema` object, so they must be in correct types (ie. not in dictionary/json format). The values are added at main level, without recursive merging (because we're adjusting `Schema` object and not a dictionary). Recursive merge would be much more work. Chose not to implement the same for `ResponseSpec` because response models are generated as schema components, while `ResponseSpec` can be locally different. Handling the logic of creating new components when `schema_extra` is passed in `ResponseSpec` would be extra effort, and isn't probably as important as being able to adjust the inbound parameters, which are actually validated (and for which the documentation is even more important, than for the response). * Update litestar/params.py Co-authored-by: Jacob Coffee <[email protected]> * Update litestar/params.py Co-authored-by: Jacob Coffee <[email protected]> * Update litestar/params.py Co-authored-by: Jacob Coffee <[email protected]> --------- Co-authored-by: Jacob Coffee <[email protected]>
* feat: Added precedence of CLI parameters over envs * Update docs/usage/cli.rst Co-authored-by: Peter Schutt <[email protected]> * Remove redundant LitestarEnv fields and fix tests * Update docs/usage/cli.rst * Update litestar/cli/commands/core.py * Update docs/usage/cli.rst * Update docs/usage/cli.rst * Update litestar/cli/commands/core.py --------- Co-authored-by: kedod <kedod> Co-authored-by: Peter Schutt <[email protected]> Co-authored-by: Jacob Coffee <[email protected]>
…pe, within request_body.py (cherry picked from commit 821d3bc)
(cherry picked from commit 2835122)
(cherry picked from commit 0eded49)
(cherry picked from commit e6a1bb7)
(cherry picked from commit 6336cbf)
…pe, within request_body.py (cherry picked from commit 821d3bc)
(cherry picked from commit e6a1bb7)
…3204) * feat: Support `schema_extra` in `Parameter` and `Body` (litestar-org#3022) This adds sort of a backdoor for modifying the generated OpenAPI spec. The value is given as `dict[str, Any]` where the key must match with the keyword parameter name in `Schema`. The values are used to override items in the generated `Schema` object, so they must be in correct types (ie. not in dictionary/json format). The values are added at main level, without recursive merging (because we're adjusting `Schema` object and not a dictionary). Recursive merge would be much more work. Chose not to implement the same for `ResponseSpec` because response models are generated as schema components, while `ResponseSpec` can be locally different. Handling the logic of creating new components when `schema_extra` is passed in `ResponseSpec` would be extra effort, and isn't probably as important as being able to adjust the inbound parameters, which are actually validated (and for which the documentation is even more important, than for the response). * Update litestar/params.py Co-authored-by: Jacob Coffee <[email protected]> * Update litestar/params.py Co-authored-by: Jacob Coffee <[email protected]> * Update litestar/params.py Co-authored-by: Jacob Coffee <[email protected]> --------- Co-authored-by: Jacob Coffee <[email protected]>
d759c1a
to
58108c0
Compare
c517c0b
to
2536957
Compare
81081dd
to
a4d7ea1
Compare
4dc78a8
to
81a323f
Compare
d285738
to
7de5a82
Compare
8df1b17
to
33ded66
Compare
466de2a
to
2292b5d
Compare
dd4215a
to
126a504
Compare
New PR, based off of: #3128
Description
Fixes
Fixes #3076