Skip to content
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 enum literal input and output type hints #186

Merged
merged 17 commits into from
Jul 10, 2023

Conversation

spacether
Copy link
Contributor

@spacether spacether commented Jul 9, 2023

v3 adds enum literal input and output type hints

  • when validating enum schemas, type hint updated to show that result is always a literal
    • applies to str/int/bool schemas
  • adds output type hint for properties and items

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    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.

@spacether spacether changed the title v3 adds enum literal constraints v3 adds enum literal input and output type hints Jul 9, 2023
@spacether spacether merged commit a8b84b6 into 3_0_0 Jul 10, 2023
5 checks passed
@spacether spacether deleted the v3_adds_enum_literal_constraints branch July 10, 2023 19:04
spacether added a commit that referenced this pull request Aug 16, 2023
* Fixes java warnings

* Adds exception throw if enum values types are not allowed

* Adds and uses enumInfo

* Adds typeToValues enumInfo

* Addsstring literal output for single schema validate with enums

* Adds validate method writing for simple schema classes with enums

* Adds string and int enum type hints to return type of validate

* Adds string literal output type for single type, per literal input string

* Removes are type in validate for enum classes of type int, str, bool

* Fixes overload signatures for int/bool/str with enums

* Adds bol and int enum to object output properties

* object properties of type string with enum now have literal output types

* Adds _helper_validate_str_overload template

* Uses string overload template for multiple types

* Adds and uses bool overload template

* Adds and uses int validate overload template

* Handles int enum value for number use case, java tests fixed, samples regen
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.

None yet

1 participant