-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
v3 adds generic type info to schema classes/properties/items #174
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 tasks
spacether
changed the title
v3 adds generic type info
v3 adds generic type info to schema classes/properties/items
May 23, 2023
spacether
added a commit
that referenced
this pull request
May 31, 2023
* Adds generic type T * Fixes broken python test * Fixes for vscode basic type checking * Adds new instacne casting * Sets ValidationMetadata new type * Makes ValidationMetadata a dataclass, fixes type issues in _process_schema_classes * Fixes XBase self type errors * Makes two methods static * Fixes IntBase as_int type error * Fixes type error in NumberBase * Adds needed typing.cast calls in new methods and get_new_class fn * Fixes exponent type error * Fixes type errors in _get_new_instance_without_conversion * Fixes typ error in FileIO new * Fixes type error in BytesSchema * Fixes another type error * Adds type ignore for _GenericAlias check and origin access * Removes _takes_ascii usage * Fixes septype error * Adds __parse_isotime type fix * Fixes more date/datetime parsing errors * Adds missing return types * Changes UnsetAnyType back to AnyType * Fixes AnyType init signature * Writes new method for all composed or anytype classes * Removes quote from refclass definitions * Removes a type ignore comment * Sample regen * Adds response body generic type to ApiResponse classes * Refactors response content template * Adds response content type hint * Fixes response header passing for deserialization * Moves content schema helper * Adds header and parameter content type type hint * Adds missing imports * Adds schema types for parameters and headers * Samples updated * Removes frozendict base class from ValidationMetadata * Removes __origin__ usage * Samples regenerated * Fixes python test
spacether
added a commit
that referenced
this pull request
Jun 8, 2023
* Adds generic type T * Fixes broken python test * Fixes for vscode basic type checking * Adds new instacne casting * Sets ValidationMetadata new type * Makes ValidationMetadata a dataclass, fixes type issues in _process_schema_classes * Fixes XBase self type errors * Makes two methods static * Fixes IntBase as_int type error * Fixes type error in NumberBase * Adds needed typing.cast calls in new methods and get_new_class fn * Fixes exponent type error * Fixes type errors in _get_new_instance_without_conversion * Fixes typ error in FileIO new * Fixes type error in BytesSchema * Fixes another type error * Adds type ignore for _GenericAlias check and origin access * Removes _takes_ascii usage * Fixes septype error * Adds __parse_isotime type fix * Fixes more date/datetime parsing errors * Adds missing return types * Changes UnsetAnyType back to AnyType * Fixes AnyType init signature * Writes new method for all composed or anytype classes * Removes quote from refclass definitions * Removes a type ignore comment * Sample regen * Adds response body generic type to ApiResponse classes * Refactors response content template * Adds response content type hint * Fixes response header passing for deserialization * Moves content schema helper * Adds header and parameter content type type hint * Adds missing imports * Adds schema types for parameters and headers * Samples updated * Removes frozendict base class from ValidationMetadata * Removes __origin__ usage * Samples regenerated * Fixes python test
spacether
added a commit
that referenced
this pull request
Aug 16, 2023
* Adds generic type T * Fixes broken python test * Fixes for vscode basic type checking * Adds new instacne casting * Sets ValidationMetadata new type * Makes ValidationMetadata a dataclass, fixes type issues in _process_schema_classes * Fixes XBase self type errors * Makes two methods static * Fixes IntBase as_int type error * Fixes type error in NumberBase * Adds needed typing.cast calls in new methods and get_new_class fn * Fixes exponent type error * Fixes type errors in _get_new_instance_without_conversion * Fixes typ error in FileIO new * Fixes type error in BytesSchema * Fixes another type error * Adds type ignore for _GenericAlias check and origin access * Removes _takes_ascii usage * Fixes septype error * Adds __parse_isotime type fix * Fixes more date/datetime parsing errors * Adds missing return types * Changes UnsetAnyType back to AnyType * Fixes AnyType init signature * Writes new method for all composed or anytype classes * Removes quote from refclass definitions * Removes a type ignore comment * Sample regen * Adds response body generic type to ApiResponse classes * Refactors response content template * Adds response content type hint * Fixes response header passing for deserialization * Moves content schema helper * Adds header and parameter content type type hint * Adds missing imports * Adds schema types for parameters and headers * Samples updated * Removes frozendict base class from ValidationMetadata * Removes __origin__ usage * Samples regenerated * Fixes python test
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
So now when models are instantiated, they will show what class they are based on
Like so:
__new__
type checking warning for dictshemas__init__
method to AnyTypeSchemaOut of scope future improvement.
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/python*
.For Windows users, please run the script in Git BASH.