Skip to content

add missing import to model template #1072

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

Merged
merged 6 commits into from
Aug 25, 2024

Conversation

dorcohe
Copy link
Contributor

@dorcohe dorcohe commented Jul 13, 2024

My first pull request in this repo. I'm still learning the UTs.
I found that if I have a literal with a default value, the code uses cast without importing it from typing.

I'm still learning the UTs on this. Do you think I should open an issue?

Copy link
Collaborator

@dbanty dbanty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put the import in the property definition instead, just to match the others... though in practice it should make no difference.

Thanks for the report & fix!

@dbanty dbanty changed the title fix: add missing import to model template add missing import to model template Aug 25, 2024
@dbanty dbanty enabled auto-merge August 25, 2024 06:21
@dbanty dbanty added this pull request to the merge queue Aug 25, 2024
Merged via the queue into openapi-generators:main with commit db7a064 Aug 25, 2024
19 checks passed
@knope-bot knope-bot bot mentioned this pull request Aug 25, 2024
github-merge-queue bot pushed a commit that referenced this pull request Aug 25, 2024
> [!IMPORTANT]
> Merging this pull request will create this release

## Fixes

### Allow OpenAPI 3.1-style `exclusiveMinimum` and `exclusiveMaximum`

Fixed by PR #1092. Thanks @mikkelam!

### Add missing `cast` import when using `const`

Fixed by PR #1072. Thanks @dorcohe!

### Correctly resolve references to a type that is itself just a single
allOf reference

PR #1103 fixed issue #1091. Thanks @eli-bl!

### Support `const` booleans and floats

Fixed in PR #1086. Thanks @flxdot!

Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>
micha91 pushed a commit to micha91/openapi-python-client that referenced this pull request May 13, 2025
My first pull request in this repo. I'm still learning the UTs. 
I found that if I have a literal with a default value, the code uses
cast without importing it from typing.

I'm still learning the UTs on this. Do you think I should open an issue?

---------

Co-authored-by: Dylan Anthony <[email protected]>
Co-authored-by: Dylan Anthony <[email protected]>
micha91 pushed a commit to micha91/openapi-python-client that referenced this pull request May 13, 2025
> [!IMPORTANT]
> Merging this pull request will create this release

## Fixes

### Allow OpenAPI 3.1-style `exclusiveMinimum` and `exclusiveMaximum`

Fixed by PR openapi-generators#1092. Thanks @mikkelam!

### Add missing `cast` import when using `const`

Fixed by PR openapi-generators#1072. Thanks @dorcohe!

### Correctly resolve references to a type that is itself just a single
allOf reference

PR openapi-generators#1103 fixed issue openapi-generators#1091. Thanks @eli-bl!

### Support `const` booleans and floats

Fixed in PR openapi-generators#1086. Thanks @flxdot!

Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants