-
-
Notifications
You must be signed in to change notification settings - Fork 301
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
Change ordering of actions #1961
Conversation
Update the ordering of the actions as the one literal on default option is not working for descriminator properties
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1961 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 38 38
Lines 4205 4205
Branches 976 976
=========================================
Hits 4205 4205
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging #1961 will not alter performanceComparing Summary
|
@prmshepherd |
Hi @koxudaxi, sorry I have this in draft as more work is needed by me. My use-case is when I am using a discriminator
This generates:
What I would like is But I think the ordering of those actions prevents that |
@prmshepherd |
|
||
class RequestV1(RequestBase): | ||
request_id: str = Field(..., description='there is description', title='test title') | ||
version: Literal['v1'] = 'v1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generator now correctly adds the default for the literal
'openapi', | ||
'--output-model-type', | ||
'pydantic_v2.BaseModel', | ||
'--use-one-literal-as-default', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting --use-one-literal-as-default in the test
@koxudaxi Sorry for the delay on this. I've added the test case now |
@koxudaxi I've fixed that test error with the extraneous args - I'm not sure why I didn't see that on my local run. |
@koxudaxi is anything more needed from me for this one? |
Update the ordering of the actions as the one literal on default option is not working for descriminator properties