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

Shortens operation + response files, improves request body serialize typing #195

Merged
merged 56 commits into from
Jul 31, 2023

Conversation

spacether
Copy link
Contributor

@spacether spacether commented Jul 25, 2023

  • operation files shortened by extracting Path/Query/Header/CookieParameters into separate schema files
  • response files shortened by extracting HeaderParameters into a separate file
  • avoids schema module name collision in parameter schema modules, module names now aliased with general logic
  • improves request body serialize type hints

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 marked this pull request as draft July 25, 2023 22:26
@spacether spacether changed the title Improves Operation Imports Shortens operation file Jul 27, 2023
@spacether spacether changed the title Shortens operation file Shortens operation files Jul 31, 2023
@spacether spacether marked this pull request as ready for review July 31, 2023 20:09
@spacether spacether changed the title Shortens operation files Shortens operation + response files, improves requesr body serialize typing Jul 31, 2023
@spacether spacether changed the title Shortens operation + response files, improves requesr body serialize typing Shortens operation + response files, improves request body serialize typing Jul 31, 2023
@spacether spacether merged commit 7d0bf9e into 3_0_0 Jul 31, 2023
@spacether spacether deleted the v3_improves_operation_imports branch July 31, 2023 22:06
spacether added a commit that referenced this pull request Aug 16, 2023
…typing (#195)

* Generates separate file for pathparameters

* Adds x_parameters files

* Fixes typo

* Passes body_info into _get_fields_and_body

* Adds RequestBodyInfo ref linking

* Fixes body types in BodyInfoForX

* Fixes one python test

* Fixes one test

* Fixes another test

* Fixes test_body_with_query_params

* Fixes test_composed_one_of_different_types

* Fixes test_inline_composition

* Fixes test_json_patch

* Fixes test_json_with_charset

* Fixes test_mammal, test_missing_or_unset_required_body

* Fixes two tests

* Fixes two tests

* Fixes two tests

* Fixes two tests

* Fixes last python test

* Allows body_info to be None

* Adds request_body imports for endpoint code sample

* Adds body_info to endpoint docs

* Stops generating requestbodyinfo schemas for refed schemas

* Dereferences request body schemas

* Improves refModuleAlias values, prevents collisions based on usages

* Samples regenerated

* Samples actually regenerated

* Fixes test for the nonCOmpliantDiscriminator sample

* Fixes unit tests

* Runs ensure up to date

* Adds content type back in

* Adds content type overload condition branch

* Adds per content type operation overloads

* Removes unused getContentTypeToOperation, adds requestBodySchema

* Adds and sets requestBodySchema in CodegenOperation

* Uses a linkedhashmap to store properties before making requestBodySchema

* Uses requestBodySchema.properties to define type hints for operation fn implementation signature

* Adds request body schema imports at the top of the operation file

* Adds body type hints for operation

* Switches code back to using body + content_type

* FIxes two tests

* Runs black on file, fixes three tests

* Fixes 3 tests

* Fixes 3 more tests

* Updates operation variable names

* Fixes body schema input type to use refModuleAlias, samples regen

* FIxes unitt est specs

* Updates templates to remove RequestBodyInfo

* Samples regenerated

* Updates operation to directly import query cookie header path param schema classes

* Sets skip_validation to True in _get_used_path

* FIxes mypy type errors, improves request body typing

* Samples regen

* Fixes typo

* Removes unused doc import
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