Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Updates __new__ to take one arg input #183

Merged
merged 36 commits into from
Jun 13, 2023
Merged

Updates __new__ to take one arg input #183

merged 36 commits into from
Jun 13, 2023

Conversation

spacether
Copy link
Contributor

@spacether spacether commented Jun 8, 2023

  • __new__ uses only one arg input
  • updated type object input to use one input of type Mapping or TypedDict
    • type is TypedDict (additionalProperties=False) or typing.Mapping[str, ...]
  • code samples now define object inputs as a dict
  • Schema input arg_ -> arg
  • Schema input configuration_ -> configuration
  • from_openapi_data_ deleted because new can now be used for it

Future

  • add a get_input_dict_ helper method (use it for mapping)
  • ensure that all new overloads are being written

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 added 30 commits June 7, 2023 23:12
@spacether spacether changed the title v3 new overload Updates __new__ to take one arg input Jun 12, 2023
@spacether spacether merged commit ccfc719 into 3_0_0 Jun 13, 2023
@spacether spacether deleted the v3_new_overload branch June 13, 2023 04:48
spacether added a commit that referenced this pull request Aug 16, 2023
* Adds section for required property type writing

* Adds required property classes

* Adds template adjustment for optional properties

* Adds template to write optional properties typeddict

* Successfully generates required and optional typeddicts

* Writes DictInput class to store required and optional input properties

* Changes new dict inptut type for arg_ and changes args_* to arg_

* Update new signature

* Removes unsets from optional properties, allows self in when optionalandreqproperties exist

* Typeddicts only generated when addProps is false

* Tweaks when reqanoptprops are generated

* Adds types to dictchema input

* Adds many use cases object inputs

* Adds req property mapping writing when addprops set

* Adds last required object type definition

* Fixes allAreInline for DictInput

* Adds optional properties type hint when addProps unset

* Adds and uses new partial

* Adds mapping type for required + opt + addProps

* Writes all property input mapping types

* Updates new signature to use DictInput for all object use cases

* Updates 3 test files

* Fixes more python tests

* Fixes manual tests

* Fixes python tests

* Converts example properties into example keys, fixes schema naming bug

* Adds braces aroudn object input

* Fixes example addProp key

* arg_ -> arg

* Schema input configuration_ -> configuration

* Removes 'from_openapi_data_'

* Fixes java tests

* Samples regenerated

* Unit test sample updated

* Fixes bug with allof/anyOf/oneOf type names

* Fixes python non compliant discriminator test
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant